package com.gtw.composite;

public class Component {

    /**
     * 设置此属性是为了向上遍历和从中间某一节点向上向下遍历
     */
    private Component parent;

    /**
     * 定义一些默认属性行为,个体和整体都共享的业务
     */
    public void doSomething(){
        System.out.println("个体和整体都共享的操作");
    }

    public Component getParent() {
        return parent;
    }

    public void setParent(Component parent) {
        this.parent = parent;
    }
}
